package com.sunchangpeng.microservicemovie.controller;

import com.sunchangpeng.microservicemovie.manager.user.UserMicroservice;
import com.sunchangpeng.microservicemovie.manager.user.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by sunchangpeng
 */
@RestController
public class MovieController {
    @Autowired
    private UserMicroservice userMicroservice;

    @GetMapping("/user/{id}")
    public User findUserById(@PathVariable Long id) {
        return userMicroservice.findById(id);
    }
}
